package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.User;
import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.vo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author Justin Parker
 * @Date 2024/8/3 0003 17:47
 * @Version 1.0
 */
@Mapper
public interface WeiboMapper {
//    @Insert("insert into weibo ( content,created,user_id) values(#{content},#{created},#{userId})")
    int insertWeibo(Weibo weibo);

//    @Update("update weibo set id = #{id},content=#{content},created=#{created},user_id=#{userId} where id=#{id}")
    int updateWeibo(Weibo weibo);

//    @Delete("delete from weibo where id=#{id}")
    int deleteWeibo(Weibo weibo);

//    @Select("select id,content,created,user_id userId from weibo where id=#{wid}")
    Weibo selectWeibo(Long wid);


//    @Select("select id,content,created,user_id userId from weibo where user_id=#{uid}")
    List<Weibo> selectWeiboByUserId(Long uid);

//    @Select("select content,created  from weibo where id=#{wid}")
    WeiboVo1 selectWeiboVo1(Long wid);

//    @Select("select content,user_id userId from weibo")
    List<WeiboVo2> selectWeiboVo2();

    /**
     *  动态修改
     */
    int dynamicUpdate(Weibo weibo);

    int deleteWeiboByIds1(Long[] ids);

    int deleteWeiboByIds2(List<Long> ids);

    int countWeibo();

    ResultMapVO1 selectMapper1(Long wid);

    ResultMapVO2 selectMapper2(Long uid);

    ResultMapVO3 selectMapper3(Long wid);

    ResultMapVO4 selectMapper4(Long wid);
}
